home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGASIC
/
BASFILES.LZH
/
HFRHAND.BAS
< prev
next >
Wrap
BASIC Source File
|
1988-07-07
|
4KB
|
246 lines
'$INCLUDE: '\include\qbtools2.inc'
DECLARE SUB HtxEdit ()
' hFrameHandler SUB to handle Help Text Frames, displayed
hB.FileName = "TEST"
hB.FrameNum = 1
hB.PosDisplay = 1
hB.Border = 1
hB.Bfg = 7
hB.Bbg = 0
hB.Tfg = 0
hB.Tbg = 7
hB.Ounf = 7
hB.Ounb = 0
hB.Oslf = 0
hB.Oslb = 7
hFrameHandler hB
DEFSNG A-Z
SUB hFrameHandler (hB AS hBuffer) STATIC
DIM Htxt$(9), Halt$(9), Hpoint$(9), Altern$(9), AltPoint%(9)
DIM Scr%(2000), Ok%(42)
SaveScreen Scr%(1)
Number% = FREEFILE
fl$ = hB.FileName
Trim fl$
fl$ = fl$ + ".FRM"
OPEN fl$ FOR RANDOM AS #Number% LEN = 648
Pcount% = 0
FOR j% = 1 TO 9
FIELD #Number%, Pcount% AS Dummy$, 50 AS Htxt$(j%), 20 AS Halt$(j%), 2 AS Hpoint$(j%)
Pcount% = Pcount% + 72
NEXT j%
Gframe% = hB.FrameNum
IF Gframe% < 0 THEN ' This is a reference to a HELP TEXT
' debug item call! i.e, this is in
' DEBUG mode, and text may be modified
hDebug% = 1
Gframe% = ABS(Gframe%)
ELSE ' Normal.....
hDebug% = 0
END IF
FrameOn% = 0 ' No frame there yet!
IF hDebug% = 1 THEN
hB.PosDisplay = 1
END IF
IF hB.PosDisplay = 1 THEN
Topx% = 3
Topy% = 1
Topsx% = 57
Topsy% = 1
ELSE
Topx% = 3
Topy% = 12
Topsx% = 57
Topsy% = 12
END IF
DO
IF Gframe% = 0 THEN
EXIT DO
END IF
GET #Number%, Gframe%
Altv% = 0
FOR j% = 1 TO 9
Tmp$ = Halt$(j%)
Trim Tmp$
IF LEN(Tmp$) THEN
Altv% = Altv% + 1
Altern$(Altv%) = Tmp$
AltPoint%(Altv%) = CVI(Hpoint$(j%))
END IF
NEXT j%
'
' If there are no alternate choices here, then just exit
'
IF Altv% = 0 THEN
EXIT DO
END IF
IF FrameOn% = 0 THEN
FrameOn% = 1
DrawBox Topy%, Topx%, 52, 11, hB.Border, hB.Bfg, hB.Bbg, 1, hB.Tfg, hB.Tbg
Cattr% = Attributes%(hB.Tfg, hB.Tbg, 0, 0)
Ok%(41) = 1
END IF
FOR j% = 1 TO 9
ColorPrint Htxt$(j%), j% + Topy%, Topx% + 1, Cattr%
NEXT j%
GOSUB DebugMode
rv% = 1
ScrollBox Altern$(), 20, 9, Topsx%, Topsy%, hB.Bfg, hB.Ounf, hB.Ounb, hB.Oslb, hB.Oslf, 0, Altv%, Ok%(), rv%, rst$, GlbErr%
IF rv% > 0 THEN
Gframe% = AltPoint%(rv%)
ELSE
EXIT DO
END IF
LOOP
CLOSE #Number%
RestoreScreen Scr%(1)
EXIT SUB
DebugMode:
HtxEdit ' Display the startup screen
FrameNum% = Gframe%
GET #Number%, FrameNum%
FOR j% = 1 TO 9
Row% = j% + 6
h$ = Htxt$(j%)
QuickPrint h$, Row%, 2
h$ = Halt$(j%)
QuickPrint h$, Row%, 54
LOCATE Row%, 75, 0
PRINT USING "####"; CVI(Hpoint$(j%))
NEXT j%
cx% = 1 ' Current X Location
Cy% = 1 ' Current Y Location
DO
Row% = Cy% + 6
Aup% = 1
Adn% = 1
IF Cy% = 1 THEN
Aup% = 0
END IF
IF Cy% = 9 THEN
Adn% = 0
END IF
SELECT CASE cx%
CASE 1
Wid% = 50
h$ = Htxt$(Cy%)
Col% = 2
CASE 2
Wid% = 20
h$ = Halt$(Cy%)
Col% = 54
CASE ELSE
END SELECT
SELECT CASE cx%
CASE 1, 2
TextInput Aup%, 0, Adn%, 0, 1, 1, 1, Wid%, h$, Col%, Row%, 7, 0, 0, Ek%
SELECT CASE cx%
CASE 1
LSET Htxt$(Cy%) = h$
CASE 2
LSET Halt$(Cy%) = h$
CASE ELSE
END SELECT
CASE 3
Nv# = CDBL(CVI(Hpoint$(Cy%)))
St$ = ""
NumericInput Aup%, 0, Adn%, 0, 1, 1, 1, 4, 0, 1000, 0, St$, Nv#, 75, Row%, 7, 0, Ek%
LSET Hpoint$(Cy%) = MKI$(CINT(Nv#))
CASE ELSE
END SELECT
SELECT CASE Ek%
CASE 1
Cy% = Cy% - 1
CASE 3
Cy% = Cy% + 1
IF Cy% > 9 THEN
Cy% = 1
END IF
CASE 5, 6
cx% = cx% + 1
IF cx% > 3 THEN
Cy% = Cy% + 1
cx% = 1
IF Cy% > 9 THEN
Cy% = 1
END IF
END IF
CASE 7
PUT #Number%, FrameNum%
EXIT DO
CASE ELSE
END SELECT
LOOP
RETURN
END SUB